#include <iostream>
using namespace std;
int main ()

{
    char caracter;
    int i;
    string cadena;

    cout << "Ingrese una cadena" << endl;
    cin >> cadena;
    cout << "Ingrese una letra" << endl;
    cin >> caracter;

    i = cadena.length()-1;

    while (i > 0)
    {
        if (cadena[i] == caracter)
        {
            cout << i+1;
            break;
        }

        i = i + 1;
    }
    if (i == cadena.length())
    {
        cout << "El caracter no esta en la palabra";
    }

    return 1;
}
